import TYPES from '@redux/config/action_types.js';
import Request from '@ajax/index.jsx';
import {APIS_HOME, APIS_NAV_TREE} from '@apis/index.js';
const _req = new Request();


const TESTREEACTION = () => async (dispatch) => {
    let options = APIS_HOME.HOMEMAP(1);
    let resData = await _req.axios(options);
    return dispatch({
        type: TYPES.TEST_TREES,
        payload: resData
    });
};


const TESTORGACTION = () => async (dispatch) => {
    let options = APIS_NAV_TREE.TREELIST(0);
    let resData = await _req.axios(options);
    return dispatch({
        type: TYPES.TEST_ORIGS,
        payload: resData.subs
    });
};


export default {
    TESTREEACTION,
    TESTORGACTION
}